﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Algorithm.Easy_977_SortedSquares
{
    class MainProject
    {
        static void Main(string[] args)
        {
            foreach (var item in SortedSquares(new int[] { -7, -3, 2, 3, 11 }))
            {
                Console.WriteLine(item);
            }

            Console.ReadKey();
        }
        public static int[] SortedSquares(int[] nums)
        {
            int[] res = new int[nums.Length];
            for (int i = 0; i < nums.Length; i++)
            {
                res[i] = nums[i] * nums[i];
            }
            Array.Sort(res);
            return res;
        }
    }
}
